//全局区
//全局变量和静态变量存放在此
//全局区还包含了常量区
//该区域的数据在程序结束后由操作系统释放

#include <iostream>

using namespace std;

int g_a = 10;
int g_b = 10;

//const修饰的全局变量
const int c_g_a = 10;
const int c_g_b = 10;
int main(void)
{
    //创建普通局部变量
    int a = 10;
    int b = 10;

    //const修饰的局部变量
    const int c_a = 10;
    const int c_b = 10;

    //创建静态变量：static
    static int s_a = 10;
    static int s_b = 10;

    

    //常量
    //字符串常量

    cout << "局部变量a的地址：" << (long long)&a << endl;
    cout << "局部变量b的地址：" << (long long)&b << endl;

    cout << "const修饰的局部变量c_a的地址：" << (long long)&c_a << endl;
    cout << "const修饰的局部变量c_b的地址：" << (long long)&c_b << endl;

    cout << "全局变量g_a的地址：" << (long long)&g_a << endl;
    cout << "全局变量g_b的地址：" << (long long)&g_b << endl;

    cout << "const全局变量c_g_a的地址：" << (long long)&c_g_a << endl;
    cout << "const全局变量c_g_b的地址：" << (long long)&c_g_b << endl;

    cout << "静态变量s_a的地址：" << (long long)&s_a << endl;
    cout << "静态变量s_b的地址：" << (long long)&s_b << endl;

    cout << "字符串常量的地址：" << (long long)&"hello,world!" << endl;

    return 0;
}